<%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2020/12/17
  Time: 16:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ page session="true" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>查看帖子列表</title>
</head>
<body>
<%@ include file="adminBanner.jsp" %>
    <h1 style="margin-left: 3%;">查看帖子列表</h1>
    <div class="postList" style="margin-left: 7%;">
        <h2 style="margin-left: 1%;">主题列表</h2>
        <ul class="postList" >
            <c:forEach items="${postList.items}" var="item">
                postID: ${item.postID} 主题：${item.topic} <br>
                    发布者：<%--${item.poster}--%> 发布时间: <fmt:formatDate value="${item.postedTime}" pattern="yyyy-MM-dd HH:mm:ss" /> 点击量：${item.clickCount}
                <c:if test="${item.state eq 1}" >
                    未置顶  <a href="<c:url value="/admin/setTop/${item.postID}" /> ">点击置顶</a>
                </c:if>
                <c:if test="${item.state eq 2}">
                    已置顶  <a href="<c:url value="/admin/setTop/${item.postID}" /> ">点击取消置顶</a>
                </c:if>
                <a href="<c:url value="/admin/deletePost/${item.postID}" /> ">删除</a>
                <a href="<c:url value="/admin/editPost/${item.postID}" /> ">编辑帖子</a>
                <br> <hr>
            </c:forEach>
        </ul>
    </div>
    每页${postList.pageSize}个帖子, 第${postList.currentPageNo}/${postList.totalPageCount}页, 共${postList.totalCount}条帖子
    <c:if test="${postList.previousPage}">
        <a href="<c:url value="/post/postList?pageNo=${postList.currentPageNo-1}"/> ">上一页</a>
    </c:if>
    <c:if test="${postList.nextPage}">
        <a href="<c:url value="/post/postList?pageNo=${postList.currentPageNo+1}" /> ">下一页</a>
    </c:if>
<%@ include file="footer.jsp" %>
</body>
</html>
